import os.path
from django.conf.urls.defaults import patterns, include, url
from wiki.views import *

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

site_media = os.path.join(os.path.dirname(__file__), 'site_media')

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'initki.views.home', name='home'),
    # url(r'^initki/', include('initki.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
	
	# TODO: main page is list_page.
	(r'^$', list_page),
	(r'^list/$', list_page),
	(r'^delete/(\w+)/$', delete_page),
	(r'^view/(\w+)/$', view_page),
	(r'^edit/([\w]*)[/]?$', edit_page),
#	(r'^new/$', new_page),
	(r'^login/$','django.contrib.auth.views.login'),
	(r'^logout/$', logout_page),
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':site_media}),
)
